package cn.jobstart.common.algorithm;

import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.Base64;

/**
 * @author sunke
 * @version 1.0
 * @Description
 * @date 2023-11-01 14:43
 */
public class UniqueNumberToStringConverter {

    public static String convert(long uniqueNumber) {
        BigInteger bigInteger = BigInteger.valueOf(uniqueNumber);
        byte[] bytes = bigInteger.toByteArray();
        String uniqueString = new String(bytes, StandardCharsets.UTF_8);
        return Base64.getEncoder().encodeToString(uniqueString.getBytes());
    }

}
